//
//  CalculatorResultText.swift
//  ToDo
//
//  Created by yanhangpu on 2021/7/7.
//

import SwiftUI

struct CalculatorResultText: View {
    
    var title = "0"
    
    let action:() -> Void
    
    var body: some View {
        Text(self.title)
            .font(.system(size: 76))
            .foregroundColor(.white)
            .frame(minWidth: 0, idealWidth: .infinity, maxWidth: .infinity, minHeight: 100, idealHeight: 100, maxHeight: 100, alignment: .trailing)
            .lineLimit(1)
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 24))
            .onTapGesture {
                action()
            }
    }
}

struct CalculatorResultText_Previews: PreviewProvider {
    static var previews: some View {
        CalculatorResultText(title: "0", action: {
            
        })
    }
}
